import path from 'node:path';
import { fileURLToPath } from 'url';
import { execSync } from 'child_process';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

execSync('npm run build', {
    stdio: 'inherit',
    encoding: 'utf-8',
    cwd: path.resolve(__dirname, '../')
});

execSync('npm publish', {
    stdio: 'inherit',
    encoding: 'utf-8',
    cwd: path.resolve(__dirname, '../bundle')
});
